<template>
  <div>
    <p>用户名：{{ $store.state.userInfoModule.userName }}</p>
    <p>用户名：{{ userName }}</p>
  </div>
</template>

<script>
import {
  // mapState,
  // mapMutations,
  // mapGetters,
  mapActions,
} from 'vuex';

export default {
  methods: {
    ...mapActions(['userInfoModule/loadInfo']),
  },
  computed: {
    userName() {
      return this.$store.state.userInfoModule.name;
    },
    // ...mapGetters('userInfoModule', ['name']),
  },
  mounted() {
    this.$store.dispatch('userInfoModule/loadInfo');
  },
};
</script>

<style>

</style>
